﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Registration.aspx.cs" Inherits="Corsat.Web.Registration"
    EnableEventValidation="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../smoothness/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/JScript.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <style type="text/css">
        .progressBackgroundFilter
        {
            position: fixed;
            top: 0px;
            bottom: 0px;
            left: 0px;
            right: 0px;
            overflow: hidden;
            padding: 0;
            margin-left: auto;
            margin-right: auto;
            background-color: #000;
            filter: alpha(opacity=50);
            opacity: 0.5;
            z-index: 1000;
        }
        
        .processMessage
        {
            margin-left: auto;
            margin-right: auto;
            position: fixed;
            top: 30%;
            left: 43%;
            padding: 10px;
            width: 14%;
            z-index: 1001;
            background-color: #fff;
            border: solid 1px #000;
            text-align: center;
        }
        
        .modalBackground
        {
            background-color: Gray;
            filter: alpha(opacity=70);
            opacity: 0.7;
        }
        
        .modalPopup
        {
            background-color: #ffffdd;
            border-width: 3px;
            border-style: solid;
            border-color: Gray;
            padding: 3px;
            width: 400px;
        }
        
        .modalPopup p
        {
            padding: 5px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="formScriptManager" runat="server">
    </asp:ScriptManager>
    <div style="background: url( 'http://www.corsat-youthbishopric.com/Arabic/images/themes/website-background.jpg' ) fixed center top;">
        <asp:UpdatePanel ID="uPnlAccount" runat="server">
            <ContentTemplate>
                <table align="center" style="width: 800px; font-size: x-large; font-weight: bold;
                    direction: rtl;">
                    <tr>
                        <td colspan="4" align="center">
                            <asp:Label ID="lblHeader" runat="server" Text="برجاء ملء البيانات الآتية" Font-Bold="True"
                                Font-Size="XX-Large"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" align="center">
                            <asp:Panel ID="pnlAlreadyRegisteredNotification" runat="server" GroupingText="ملحوظة">
                                <asp:Label ID="lblAlreadyRegisteredMessage" runat="server" Text="إذا كنت مسجل من قبل، برجاء الضغط "
                                    ForeColor="#CC0000"></asp:Label>
                                <a id="showModalPopupClientButton" href="#" onclick="showModalPopupViaClient(event,'programmaticModalPopupBehavior_AlreadyRegistered')">
                                    هنا</a>
                            </asp:Panel>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <hr />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblFullName" runat="server" Text="الإسم رباعى بالعربية" Width="100%"></asp:Label>
                        </td>
                        <td colspan="3" align="center">
                            <asp:TextBox ID="tbArabicName_P1" runat="server" Width="20%" Height="30px" Style="font-size: large;
                                text-align: center" onkeypress="return isNumberOrEnglishLetterKey(event);"></asp:TextBox>
                            <asp:TextBox ID="tbArabicName_P2" runat="server" Width="20%" Height="30px" Style="font-size: large;
                                text-align: center" onkeypress="return isNumberOrEnglishLetterKey(event);"></asp:TextBox>
                            <asp:TextBox ID="tbArabicName_P3" runat="server" Width="20%" Height="30px" Style="font-size: large;
                                text-align: center" onkeypress="return isNumberOrEnglishLetterKey(event);"></asp:TextBox>
                            <asp:TextBox ID="tbArabicName_P4" runat="server" Width="20%" Height="30px" Style="font-size: large;
                                text-align: center" onkeypress="return isNumberOrEnglishLetterKey(event);"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <hr />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label2" runat="server" Text="الرقم القومى" Width="100%"></asp:Label>
                        </td>
                        <td colspan="3" align="center">
                            <asp:TextBox ID="tbSSN" runat="server" Height="30px" onkeypress=" return isNumberKey(event) && ValidateTextLength('tbSSN',14);"
                                Style="font-size: large; text-align: center" Width="300px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <hr />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblEmail" runat="server" Text="البريد الإلكترونى" Width="100%"></asp:Label>
                        </td>
                        <td colspan="3">
                            <asp:TextBox ID="tbEmail" runat="server" Width="100%" Height="30px" Style="font-size: large;
                                text-align: center" onblur="ValidateEmail()"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <hr />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label3" runat="server" Text="تاريخ الميلاد" Width="100%"></asp:Label>
                        </td>
                        <td style="text-align: left">
                            يوم
                            <asp:TextBox ID="tbDay" runat="server" Width="30px" Height="30px" Style="font-size: large;
                                text-align: center;" onkeypress=" return isNumberKey(event) && ValidateTextLength('tbDay',2);"></asp:TextBox>
                        </td>
                        <td align="center">
                            شهر
                            <asp:DropDownList ID="ddlMonth" runat="server" Height="30px" Style="font-size: large">
                                <asp:ListItem Text="يناير" Value="1" />
                                <asp:ListItem Text="فبراير" Value="2" />
                                <asp:ListItem Text="مارس" Value="3" />
                                <asp:ListItem Text="أبريل" Value="4" />
                                <asp:ListItem Text="مايو" Value="5" />
                                <asp:ListItem Text="يونيو" Value="6" />
                                <asp:ListItem Text="يوليو" Value="7" />
                                <asp:ListItem Text="أغسطس" Value="8" />
                                <asp:ListItem Text="سبتمير" Value="9" />
                                <asp:ListItem Text="أكتوبر" Value="10" />
                                <asp:ListItem Text="نوفمبر" Value="11" />
                                <asp:ListItem Text="ديسمبر" Value="12" />
                            </asp:DropDownList>
                        </td>
                        <td>
                            سنة
                            <asp:TextBox ID="tbYear" runat="server" Width="60px" Height="30px" Style="font-size: large;
                                text-align: center;" onkeypress=" return isNumberKey(event) && ValidateTextLength('tbYear',4);"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <hr />
                        </td>
                    </tr>
                    <tr>
                        <td width="20%">
                            <asp:Label ID="Label5" runat="server" Text="الحى / الإيبارشية" Width="100%"></asp:Label>
                        </td>
                        <td width="30%">
                            <asp:DropDownList ID="ddlDiocese" runat="server" Width="100%" Height="30px" Font-Bold="False"
                                Font-Size="Large" OnSelectedIndexChanged="ddlDiocese_SelectedIndexChanged" AutoPostBack="true">
                            </asp:DropDownList>
                        </td>
                        <td width="20%">
                            <asp:Label ID="Label4" runat="server" Text="الكنيسة" Width="100%" Style="text-align: left"></asp:Label>
                        </td>
                        <td width="30%">
                            <asp:UpdateProgress ID="UpdateProgress2" runat="server">
                                <ProgressTemplate>
                                    <div class="progressBackgroundFilter">
                                    </div>
                                    <div class="processMessage">
                                        جارى التحميل...<br />
                                        <br />
                                        <img alt="Loading..." src="Images/Loading.gif" />
                                    </div>
                                </ProgressTemplate>
                            </asp:UpdateProgress>
                            <asp:UpdatePanel ID="upChurchs" runat="server">
                                <ContentTemplate>
                                    <asp:DropDownList ID="ddlChurch" runat="server" Width="100%" Height="30px" Font-Bold="True"
                                        Font-Size="Large">
                                    </asp:DropDownList>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="ddlDiocese" EventName="SelectedIndexChanged" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <hr />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <asp:Panel ID="pnlTelephones" runat="server" GroupingText="أرقام التليفونات">
                                <asp:GridView ID="grdTelephones" runat="server" AutoGenerateColumns="False" Width="80%"
                                    EnableModelValidation="True" OnRowCreated="grdTelephones_RowCreated">
                                    <Columns>
                                        <asp:TemplateField HeaderText="النوع" HeaderStyle-Width="40%" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:DropDownList ID="ddlTeleType" runat="server" Width="80%" Font-Size="Large" />
                                            </ItemTemplate>
                                            <HeaderStyle Width="45%" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="الرقم" HeaderStyle-Width="40%" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:TextBox ID="tbNumber" runat="server" Width="80%" Style="font-size: large; text-align: center"
                                                    onkeypress=" return isNumberKey(event);" />
                                            </ItemTemplate>
                                            <HeaderStyle Width="45%" />
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </asp:Panel>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <hr />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <asp:Panel ID="pnlCourses" runat="server" GroupingText="الــكــورســات">
                                <asp:UpdatePanel runat="server" ID="upCourses">
                                    <ContentTemplate>
                                        <ul>
                                            <asp:DataList ID="dlCourses" runat="server" OnDeleteCommand="dlCourses_DeleteCommand"
                                                Width="100%">
                                                <ItemTemplate>
                                                    <li>
                                                        <asp:Label runat="server" ID="lblCourseName" Text='<%# Bind("CourseFullName") %>' />
                                                        &nbsp;&nbsp;&nbsp; [<asp:LinkButton ID="lnkBtnDelete" runat="server" Text="مسح" CommandName="Delete"></asp:LinkButton>]
                                                    </li>
                                                </ItemTemplate>
                                            </asp:DataList>
                                        </ul>
                                        <asp:HiddenField ID="hfCoursesCount" runat="server" />
                                    </ContentTemplate>
                                    <Triggers>
                                        <asp:AsyncPostBackTrigger ControlID="btnAddCourse" EventName="Click" />
                                    </Triggers>
                                </asp:UpdatePanel>
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                    <ContentTemplate>
                                        <asp:LinkButton ID="btnAddNewCourse" runat="server" Text="إضافة كورس" OnClientClick="return ValidateRegistrationData()"
                                            OnClick="btnAddNewCourse_Click" Font-Size="Medium" />
                                    </ContentTemplate>
                                    <Triggers>
                                        <asp:AsyncPostBackTrigger ControlID="btnAddCourse" EventName="Click" />
                                        <asp:AsyncPostBackTrigger ControlID="dlCourses" EventName="DeleteCommand" />
                                    </Triggers>
                                </asp:UpdatePanel>
                                <asp:UpdatePanel ID="upChooseCourse" runat="server">
                                    <ContentTemplate>
                                        <asp:Panel ID="pnlChooseCourse" runat="server" GroupingText="إختيار كورس" Font-Bold="False"
                                            Font-Size="Large">
                                            <table width="100%">
                                                <tr>
                                                    <td colspan="4" align="center">
                                                        <asp:Label ID="lblWarning" runat="server" Style="font-size: large; color: Red; font-weight: bold;"></asp:Label>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td style="width: 10%; text-align: left;">
                                                        <asp:Label ID="lblCourseName" runat="server" Text="الإسم"></asp:Label>
                                                    </td>
                                                    <td style="width: 40%">
                                                        <asp:DropDownList ID="ddlCourseNames" runat="server" Width="100%" OnSelectedIndexChanged="ddlCourseNames_SelectedIndexChanged"
                                                            AutoPostBack="true" Style="font-size: large; margin-right: 0px">
                                                        </asp:DropDownList>
                                                    </td>
                                                    <td style="width: 40%">
                                                        <asp:UpdatePanel ID="upCourseLevels" runat="server">
                                                            <ContentTemplate>
                                                                <asp:Panel ID="pnlCourseLevels" runat="server" GroupingText="المستوى">
                                                                    <asp:RadioButtonList ID="rdoLevel" runat="server" RepeatLayout="Flow" RepeatDirection="Vertical">
                                                                    </asp:RadioButtonList>
                                                                </asp:Panel>
                                                            </ContentTemplate>
                                                            <Triggers>
                                                                <asp:AsyncPostBackTrigger ControlID="ddlCourseNames" EventName="SelectedIndexChanged" />
                                                            </Triggers>
                                                        </asp:UpdatePanel>
                                                    </td>
                                                    <td style="width: 10%">
                                                        <asp:LinkButton ID="btnAddCourse" runat="server" Text="إضافة" OnClick="btnAddCourse_Click" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </asp:Panel>
                                    </ContentTemplate>
                                    <Triggers>
                                        <asp:AsyncPostBackTrigger ControlID="btnAddCourse" EventName="ClicK" />
                                        <asp:AsyncPostBackTrigger ControlID="btnAddNewCourse" EventName="Click" />
                                        <asp:AsyncPostBackTrigger ControlID="lnkRegister" EventName="Click" />
                                    </Triggers>
                                </asp:UpdatePanel>
                            </asp:Panel>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" align="center">
                            <asp:UpdatePanel ID="upnlRegistrationResult" runat="server">
                                <ContentTemplate>
                                    <asp:Button runat="server" ID="hiddenTargetControlForModalPopup" Style="display: none" />
                                    <ajaxToolkit:ModalPopupExtender runat="server" ID="programmaticModalPopup_RegistrationResult"
                                        BehaviorID="programmaticModalPopupBehavior_RegistrationResult" TargetControlID="hiddenTargetControlForModalPopup"
                                        PopupControlID="pnlRegistrationResult" BackgroundCssClass="modalBackground" DropShadow="True"
                                        PopupDragHandleControlID="programmaticPopupDragHandle_RegistrationResult" RepositionMode="RepositionOnWindowScroll">
                                    </ajaxToolkit:ModalPopupExtender>
                                    <asp:Panel ID="pnlRegistrationResult" runat="server" CssClass="modalPopup" Style="display: none;">
                                        <asp:Panel runat="Server" ID="programmaticPopupDragHandle_RegistrationResult" Style="cursor: move;
                                            background-color: #DDDDDD; border: solid 1px Gray; color: Black; text-align: center;">
                                            <b>الكورسات المتخصصة</b>
                                        </asp:Panel>
                                        <asp:Label ID="lblRegistrationResultMessage" runat="server" Style="font-size: large"></asp:Label>
                                        <br />
                                        <asp:Label ID="lblAccountNumber" runat="server" Style="font-size: x-large; color: Green;"></asp:Label>
                                        <br />
                                        <asp:Label ID="lblRegistrationComplementaryMessage" runat="server" Style="font-size: large;"></asp:Label>
                                        <br />
                                        <a id="hideModalPopupViaClientButton" href="#" onclick="hideModalPopupViaClient(event,'programmaticModalPopupBehavior_RegistrationResult')"
                                            style="font-size: medium;">إغلاق النافذة</a> &nbsp;|&nbsp; <a href="PrintableRegistrationForm.aspx"
                                                target="_blank" style="font-size: medium;">طـبـاعـة</a>
                                    </asp:Panel>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="lnkRegister" EventName="Click" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" align="center">
                            <asp:UpdatePanel ID="upnlAlready" runat="server">
                                <ContentTemplate>
                                    <asp:Button runat="server" ID="btnHiddenAlreadyRegistered" Style="display: none" />
                                    <ajaxToolkit:ModalPopupExtender runat="server" ID="programmaticModalPopup_AlreadyRegistered"
                                        BehaviorID="programmaticModalPopupBehavior_AlreadyRegistered" TargetControlID="btnHiddenAlreadyRegistered"
                                        PopupControlID="pnlAlreadyRegistered" BackgroundCssClass="modalBackground" DropShadow="True"
                                        PopupDragHandleControlID="programmaticPopupDragHandle_AlreadyRegistered" RepositionMode="RepositionOnWindowScroll">
                                    </ajaxToolkit:ModalPopupExtender>
                                    <asp:Panel ID="pnlAlreadyRegistered" runat="server" CssClass="modalPopup" Style="display: none;">
                                        <asp:Panel runat="Server" ID="programmaticPopupDragHandle_AlreadyRegistered" Style="cursor: move;
                                            background-color: #DDDDDD; border: solid 1px Gray; color: Black; text-align: center;
                                            height: 30px; vertical-align: middle;">
                                            <a id="A2" href="#" onclick="hideModalPopupViaClient(event,'programmaticModalPopupBehavior_AlreadyRegistered')">
                                                <img src="Images/Action-cancel-icon.png" align="left" alt="إغلاق النافذة" /></a>
                                            <asp:Label ID="lblModalHeader" runat="server" Style="vertical-align: middle;" Text="الكورسات المتخصصة"
                                                Font-Size="X-Large" Font-Bold="True"></asp:Label>
                                        </asp:Panel>
                                        <asp:Label ID="Label1" runat="server" Style="font-size: large" Text="من فضلك ادخل رقمك القومى بشكل كامل و صحيح"></asp:Label>
                                        <br />
                                        <asp:TextBox ID="txtAlreadyRegistered_SSN" runat="server" Width="80%" Style="font-size: x-large;
                                            text-align: center;" onkeypress="return isNumberKey(event) && ValidateTextLength('txtAlreadyRegistered_SSN',14);" />
                                        <br />
                                        <asp:LinkButton ID="btnLoadAlreadyRegistered" runat="server" Text="تحميل البيانات"
                                            OnClick="btnLoadAlreadyRegistered_Click" />
                                    </asp:Panel>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="lnkRegister" EventName="Click" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" align="center">
                            <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                <ContentTemplate>
                                    <asp:LinkButton ID="lnkRegister" runat="server" OnClick="lnkRegister_Click" OnClientClick="return ValidateRegistrationData()">تـــــســـــجـــــيـــــل</asp:LinkButton>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="lnkRegister" EventName="Click" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnLoadAlreadyRegistered" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
